#ifndef SEMANTICNODEBLOCKGENERATE_H_
#define SEMANTICNODEBLOCKGENERATE_H_

#include "SemanticNode.h"
#include "LabeledNode.h"
#include <string>
#include <vector>

class SemanticNodeExpression;

class SemanticNodeBlockGenerate : public SemanticNode, public LabeledNode {
private:
	SemanticNodeExpression *uptoExpression; // int
	SemanticNodeExpression *afterExpression; // time
	SemanticNodeExpression *everyExpression; // time
	SemanticNodeExpression *deviationExpression; // time
	std::string name;
	std::vector<std::pair<std::string, SemanticNodeExpression *> > transactionList; // float
	bool upto, after, every, deviation, transList;

	friend std::string flattenNamePeriodAdd(const SyntaxTreeNode &nameNode);

public:
	SemanticNodeBlockGenerate(const SyntaxTreeNode *generateNodeParent, SemanticNode *parent);

	void setUptoExpression(SemanticNodeExpression *upto);
	void setAfterExpression(SemanticNodeExpression *after);
	void setEveryExpression(SemanticNodeExpression *every);
	void setDeviationExpression(SemanticNodeExpression *deviation);

	void addTransaction(std::string name, SemanticNodeExpression *probability);

	bool hasUpto();
	bool hasAfter();
	bool hasEvery();
	bool hasDeviation();
	bool hasTransactionList();

	virtual std::string toDebugString(int tab);
};

#endif /* SEMANTICNODEBLOCKGENERATE_H_ */
